package applicationFunction.socks;

public interface Socks {
    /**
     * 连接
     * client
     *  +----+----------+----------+
     *  |VER | NMETHODS | METHODS  |
     *  +----+----------+----------+
     *  | 1  |    1     | 1 to 255 |
     *  +----+----------+----------+
     *
     * server
     *  +----+--------+
     *  |VER | METHOD |
     *  +----+--------+
     *  | 1  |   1    |
     *  +----+--------+
     */
    void connect();


    /**
     * 帐号密码验证
     * client
     *  +----+------+----------+------+----------+
     *  |VER | ULEN |  UNAME   | PLEN |  PASSWD  |
     *  +----+------+----------+------+----------+
     *  | 1  |  1   | 1 to 255 |  1   | 1 to 255 |
     *  +----+------+----------+------+----------+
     *
     * server
     *  +----+--------+
     *  |VER | STATUS |
     *  +----+--------+
     *  | 1  |   1    |
     *  +----+--------+
     */
    void userPassAuth();

    /**
     * 请求
     * client
     *  +----+-----+-------+------+----------+----------+
     *  |VER | CMD |  RSV  | ATYP | DST.ADDR | DST.PORT |
     *  +----+-----+-------+------+----------+----------+
     *  | 1  |  1  | X'00' |  1   | Variable |    2     |
     *  +----+-----+-------+------+----------+----------+
     * server
     *  +----+-----+-------+------+----------+----------+
     *  |VER | REP |  RSV  | ATYP | BND.ADDR | BND.PORT |
     *  +----+-----+-------+------+----------+----------+
     *  | 1  |  1  | X'00' |  1   | Variable |    2     |
     *  +----+-----+-------+------+----------+----------+
     */
    void request();

}
